package cn.xspace.library.util;

import com.xspace.android.xafcommon.util.ClassUtil;

import java.util.HashMap;
import java.util.Map;

import cn.xspace.library.R;

/**
 * Created by liuchen on 2016/11/30.
 */

public class BuildConfig {

    public static String MODULE_KEY_MYWORK = "mywork";
    public static String MODULE_NAME_MYWORK = "工作台";

    public static String MODULE_KEY_SETTING = "setting";
    public static String MODULE_NAME_SETTING = "个人中心";

    public static String MODULE_KEY_WNX = "wnx";
    public static String MODULE_NAME_WNX = "微农信";

    public static String MODULE_KEY_HOME = "homepage";
    public static String MODULE_NAME_HOME = "首页";

    public static String MODULE_NAME_WORKLOG = "工作日志";
    public static String MODULE_KEY_WORKLOG = "worklog";

    public static String MODULE_NAME_WORKFORM = "工作表单";
    public static String MODULE_KEY_WORKFORM = "workform";

    public static String MODULE_NAME_SERCIE_OBJ = "服务对象";
    public static String MODULE_KEY_SERCIE_OBJ = "serobject";

    public static String MODULE_NAME_OFFLINE_LOAD = "离线加载";
    public static String MODULE_KEY_OFFLINE_LOAD = "offlineload";

    public static String MODULE_NAME_WORK_TODO = "我的待办";
    public static String MODULE_KEY_WORK_TODO = "workschedule";

    public static String MODULE_NAME_SUB_ORG = "下级机构";
    public static String MODULE_KEY_SUB_ORG = "suborganization";

    public static String MODULE_NAME_BT_SEARCH = "补贴查询";
    public static String MODULE_KEY_BT_SEARCH = "subsidysearch";

    public static String MODULE_NAME_DATABANK = "资料库";
    public static String MODULE_KEY_DATABANK = "databank ";

    public static String MODULE_NAME_QA_SQUARE = "问答广场";
    public static String MODULE_KEY_QA_SQUARE = "qaasquare";

    public static String MODULE_NAME_INFO_SQUARE = "资讯广场";
    public static String MODULE_KEY_INFO_SQUARE = "infosquare  ";

    public static String MODULE_KEY_APP_STORE = "appstore";
    public static String MODULE_NAME_APP_STORE = "托管机构";

    public static String MODULE_KEY_SYSTEM = "systemMgmt";
    public static String MODULE_NAME_SYSTEM = "系统管理";

    public static String MODULE_KEY_QAC = "qac";
    public static String MODULE_NAME_QAC = "在线农技员";

    public static String MODULE_KEY_SIGN = "sign";
    public static String MODULE_NAME_SIGN = "签到";

    public static String MODULE_KEY_WORKLOG_WRITE = "writeWorkLog";
    public static String MODULE_NAME_WORKLOG_WRITE = "写日志";

    public static String MODULE_KEY_INDEX = "home";
    public static String MODULE_NAME_INDEX = "首页";

    public static String MODULE_KEY_EXPLORE = "explore";
    public static String MODULE_NAME_EXPLORE = "首页";

    public static String MODULE_KEY_WORKBENCH = "workbench";
    public static String MODULE_NAME_WORKBENCH = "我的工作台";

    public static String MODULE_NAME_CONTENT_MGM = "内容管理";
    public static String MODULE_KEY_CONTENT_MGM = "contentMgmt";

    public static final String ASSENT_ICONS_NAME = "icons/";

    public static final String BROWSER = "browser";
    public static final String BROWSER_BUILD_URL = "browser_build_url";
    public static float isSlideDistance = 10;

    public enum WeclomeEnum {
        ENTER_ALPHA(1),//淡入
        EXIT_ALPHA(1),//淡出
        ENTER_NORMAL(0),//立即进入
        EXIT_NORMAL(0);//立即退出

        private int type = 0;

        public int getType() {
            return type;
        }

        WeclomeEnum(int type) {
            this.type = type;
        }
    }

    public enum NavStyle {
        TAB_STYLE(1), // 底部标签
        PONIT_STYLE(2),//点聚式
        DRAWER_STYLE(3),//抽屉式
        GRID_STYLE(4),//宫格布局
        TILE_STYLE(5);//磁贴式
        private int type = 0;

        NavStyle(int type) {
            this.type = type;
        }

        public int getType() {
            return type;
        }
    }

    public static Map<String, NativeSkip> nativeMap = new HashMap<>();

    static {
        nativeMap.put(NativeSkip.OfflineLoad.getKey(), NativeSkip.OfflineLoad);
        nativeMap.put(NativeSkip.WorkTodo.getKey(), NativeSkip.WorkTodo);
        nativeMap.put(NativeSkip.WorkLog.getKey(), NativeSkip.WorkLog);
        nativeMap.put(NativeSkip.MyWork.getKey(), NativeSkip.MyWork);
        nativeMap.put(NativeSkip.QAC.getKey(), NativeSkip.QAC);
        nativeMap.put(NativeSkip.AppStore.getKey(), NativeSkip.AppStore);
        nativeMap.put(NativeSkip.Setting.getKey(), NativeSkip.Setting);
        nativeMap.put(NativeSkip.WNX.getKey(), NativeSkip.WNX);
        nativeMap.put(NativeSkip.QACCenter.getKey(), NativeSkip.QACCenter);
        nativeMap.put(NativeSkip.WORKBENCH.getKey(), NativeSkip.WORKBENCH);
        nativeMap.put(NativeSkip.BROWER.getKey(), NativeSkip.BROWER);
        nativeMap.put(NativeSkip.HOME.getKey(), NativeSkip.HOME);
        nativeMap.put(NativeSkip.BROWER_BUILD_URL.getKey(), NativeSkip.BROWER_BUILD_URL);
    }

    public enum NativeSkip {
        OfflineLoad(MODULE_KEY_OFFLINE_LOAD,
                ClassUtil.offlineDataFragment,
                ClassUtil.offlineDataActivity, 0),//离线加载
        WorkTodo(MODULE_KEY_WORK_TODO, ClassUtil.workTotoFragment, ClassUtil.MyScheduleActivity, 0),//待办
        WorkLog(MODULE_KEY_WORKLOG, ClassUtil.workLogFragment, ClassUtil.workLogActivity, 0),//工作日志日志
        MyWork(MODULE_KEY_MYWORK, ClassUtil.myWorkFragment, ClassUtil.myWorkActivity, 0),//我的工作
        QAC(MODULE_KEY_QAC, ClassUtil.qacSquareFragment, ClassUtil.QAC_CLASS, 0),//农技员
        HOME(MODULE_KEY_HOME, ClassUtil.INDEX_FRAGMENT, ClassUtil.INDEX_CLASS, R.drawable.selector_home),//首页
        AppStore(MODULE_KEY_APP_STORE, ClassUtil.FUNCTIONCENTER_FRAGMENT, ClassUtil.FUNCTIONCENTER_CLASS, R.drawable.selector_appstore),//首页
        Setting(MODULE_KEY_SETTING, ClassUtil.SETTING_FRAGMENT, ClassUtil.SETTING_CLASS, R.drawable.selector_setting),//个人中心
        WNX(BuildConfig.MODULE_KEY_WNX, ClassUtil.WNX_CLASS_FRAGMENT, ClassUtil.WNX_CLASS, R.drawable.selector_wnx),//微农信
        QACCenter(MODULE_KEY_QA_SQUARE, ClassUtil.qacSquareFragment, ClassUtil.qacSquareActivity, 0),//问答广场
        WORKBENCH(MODULE_KEY_WORKBENCH, ClassUtil.WorkBenchFragment, ClassUtil.WorkBenchActivity, 0),//工作台
        BROWER(BROWSER, ClassUtil.WNX_WEBVIEWFragment, ClassUtil.WNX_WEBVIEWACT, R.drawable.selector_browser),//h5
        BROWER_BUILD_URL(BROWSER_BUILD_URL, ClassUtil.DCLOUD_WEBVIEW_FRAGMENT, ClassUtil.DCLOUD_WEBVIEW_ACTIVITY, R.drawable.selector_browser);//h5

        NativeSkip(String key, String fragmentName, String activityName, int resId) {
            this.key = key;
            this.fragmentClz = fragmentName;
            this.activityClz = activityName;
            this.resid = resId;
        }

        private String key = "";
        private String fragmentClz = "";
        private String activityClz = "";
        private int resid;

        public String getKey() {
            return key;
        }

        public String getFragmentClz() {
            return fragmentClz;
        }

        public String getActivityClz() {
            return activityClz;
        }

        public int getResId() {
            return resid;
        }
    }


}
